package com.yupi.maker.template.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @version 1.0
 * @Author moresuo
 * @Date 2024/9/21 17:50
 * @注释
 */
@AllArgsConstructor
@Getter
public enum FileFilterRangeEnum {
    FILE_NAME("文件名称", "fileName"),
    FILE_CONTAINS("文件包含", "fileContains");

    private String text;
    private String value;

    public static FileFilterRangeEnum getEnumByValue(String value){
        if (Objects.isNull(value)) {
            return null;
        }
        for (FileFilterRangeEnum anEnum : FileFilterRangeEnum.values()) {
            if (Objects.equals(anEnum.value, value)) {
                return anEnum;
            }
        }
        return null;
    }
}
